<?php
namespace web\controller\Index;
use web\controller\BaseController;

class IndexController extends BaseController
{

    function mergeTvmId($tvmId)
    {
        $md5_tvmId = md5($tvmId);
        preg_match_all('/\d+/',$md5_tvmId,$arrTvmSum);
        $sumTo = 0;
        foreach ($arrTvmSum[0] as $sum) {
            $sumTo += $sum;
        }
        $tvmIdSum = $tvmId.$sumTo;
        $md5_tvmId = md5($tvmIdSum);
        $tmpQidOne =  substr($md5_tvmId, 0, 8);
        $tmpQidOne1 =  substr($md5_tvmId, 12, 8);
        $tmpQidOne2 =  substr($md5_tvmId, -8);
        $Qid = 'qid' . $tmpQidOne.$tmpQidOne1.$tmpQidOne2;
        return $Qid;
    }



    public function index(){
        return $this->View->view('index');
    }



}

